
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module golem.helpers.function</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="golem.html"><font color="#ffffff">golem</font></a>.<a href="golem.helpers.html"><font color="#ffffff">helpers</font></a>.function</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/opt/local/lib/python2.4/site-packages/golem/helpers/function.py">/opt/local/lib/python2.4/site-packages/golem/helpers/function.py</a></font></td></tr></table>
    <p><tt>#&nbsp;Part&nbsp;of&nbsp;pyGolem.&nbsp;See&nbsp;LICENSE&nbsp;in&nbsp;the&nbsp;root&nbsp;of&nbsp;your&nbsp;distribution&nbsp;for&nbsp;the&nbsp;license.<br>
#&nbsp;Andrew&nbsp;Walkingshaw&nbsp;&lt;andrew@lexical.org.uk&gt;</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="golem.html">golem</a><br>
</td><td width="25%" valign=top><a href="scipy.optimize.html">scipy.optimize</a><br>
</td><td width="25%" valign=top><a href="simplejson.html">simplejson</a><br>
</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="golem.helpers.function.html#Fit">Fit</a>
</font></dt><dt><font face="helvetica, arial"><a href="golem.helpers.function.html#FitFunction">FitFunction</a>
</font></dt></dl>
</dd>
</dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Fit">class <strong>Fit</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Fit-__init__"><strong>__init__</strong></a>(self, datasource, xconcepts, yconcepts, xreducer<font color="#909090">=None</font>, yreducer<font color="#909090">=None</font>, cache<font color="#909090">=None</font>)</dt></dl>

<dl><dt><a name="Fit-addfunction"><strong>addfunction</strong></a>(self, name, function, params)</dt></dl>

<dl><dt><a name="Fit-fit"><strong>fit</strong></a>(self, name<font color="#909090">=None</font>, cache<font color="#909090">=None</font>)</dt></dl>

<dl><dt><a name="Fit-getdata"><strong>getdata</strong></a>(self, cache<font color="#909090">=None</font>)</dt></dl>

<dl><dt><a name="Fit-getfndata"><strong>getfndata</strong></a>(self, name)</dt></dl>

<dl><dt><a name="Fit-getresult"><strong>getresult</strong></a>(self, name)</dt></dl>

<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>__dict__</strong> = &lt;dictproxy object at 0x81c4950&gt;<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dl>

<dl><dt><strong>__weakref__</strong> = &lt;attribute '__weakref__' of 'Fit' objects&gt;<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;(if&nbsp;defined)</tt></dl>

</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="FitFunction">class <strong>FitFunction</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="FitFunction-__init__"><strong>__init__</strong></a>(self, function, params)</dt></dl>

<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>__dict__</strong> = &lt;dictproxy object at 0x81c4550&gt;<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dl>

<dl><dt><strong>__weakref__</strong> = &lt;attribute '__weakref__' of 'FitFunction' objects&gt;<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;(if&nbsp;defined)</tt></dl>

</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
    
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt><a name="-array"><strong>array</strong></a>(...)</dt><dd><tt><a href="#-array">array</a>(<a href="__builtin__.html#object">object</a>,&nbsp;dtype=None,&nbsp;copy=1,order=None,&nbsp;subok=0,ndmin=0)<br>
&nbsp;<br>
Return&nbsp;an&nbsp;array&nbsp;from&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;with&nbsp;the&nbsp;specified&nbsp;date-type.<br>
&nbsp;<br>
Inputs:<br>
&nbsp;&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;-&nbsp;an&nbsp;array,&nbsp;any&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;exposing&nbsp;the&nbsp;array&nbsp;interface,&nbsp;any<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;whose&nbsp;__array__&nbsp;method&nbsp;returns&nbsp;an&nbsp;array,&nbsp;or&nbsp;any<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(nested)&nbsp;sequence.<br>
&nbsp;&nbsp;dtype&nbsp;&nbsp;-&nbsp;The&nbsp;desired&nbsp;data-type&nbsp;for&nbsp;the&nbsp;array.&nbsp;&nbsp;If&nbsp;not&nbsp;given,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;type&nbsp;will&nbsp;be&nbsp;determined&nbsp;as&nbsp;the&nbsp;minimum&nbsp;type&nbsp;required<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;hold&nbsp;the&nbsp;objects&nbsp;in&nbsp;the&nbsp;sequence.&nbsp;&nbsp;This&nbsp;argument&nbsp;can&nbsp;only<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;be&nbsp;used&nbsp;to&nbsp;'upcast'&nbsp;the&nbsp;array.&nbsp;&nbsp;For&nbsp;downcasting,&nbsp;use&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.astype(t)&nbsp;method.<br>
&nbsp;&nbsp;copy&nbsp;&nbsp;&nbsp;-&nbsp;If&nbsp;true,&nbsp;then&nbsp;force&nbsp;a&nbsp;copy.&nbsp;&nbsp;Otherwise&nbsp;a&nbsp;copy&nbsp;will&nbsp;only&nbsp;occur<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;__array__&nbsp;returns&nbsp;a&nbsp;copy,&nbsp;obj&nbsp;is&nbsp;a&nbsp;nested&nbsp;sequence,&nbsp;or<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;copy&nbsp;is&nbsp;needed&nbsp;to&nbsp;satisfy&nbsp;any&nbsp;of&nbsp;the&nbsp;other&nbsp;requirements<br>
&nbsp;&nbsp;order&nbsp;&nbsp;-&nbsp;Specify&nbsp;the&nbsp;order&nbsp;of&nbsp;the&nbsp;array.&nbsp;&nbsp;If&nbsp;order&nbsp;is&nbsp;'C',&nbsp;then&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array&nbsp;will&nbsp;be&nbsp;in&nbsp;C-contiguous&nbsp;order&nbsp;(last-index&nbsp;varies&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fastest).&nbsp;&nbsp;If&nbsp;order&nbsp;is&nbsp;'FORTRAN',&nbsp;then&nbsp;the&nbsp;returned&nbsp;array<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;will&nbsp;be&nbsp;in&nbsp;Fortran-contiguous&nbsp;order&nbsp;(first-index&nbsp;varies&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fastest).&nbsp;&nbsp;If&nbsp;order&nbsp;is&nbsp;None,&nbsp;then&nbsp;the&nbsp;returned&nbsp;array&nbsp;may<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;be&nbsp;in&nbsp;either&nbsp;C-,&nbsp;or&nbsp;Fortran-contiguous&nbsp;order&nbsp;or&nbsp;even<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;discontiguous.<br>
&nbsp;&nbsp;subok&nbsp;&nbsp;-&nbsp;If&nbsp;True,&nbsp;then&nbsp;sub-classes&nbsp;will&nbsp;be&nbsp;passed-through,&nbsp;otherwise<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;returned&nbsp;array&nbsp;will&nbsp;be&nbsp;forced&nbsp;to&nbsp;be&nbsp;a&nbsp;base-class&nbsp;array<br>
&nbsp;&nbsp;ndmin&nbsp;&nbsp;-&nbsp;Specifies&nbsp;the&nbsp;minimum&nbsp;number&nbsp;of&nbsp;dimensions&nbsp;that&nbsp;the&nbsp;resulting<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array&nbsp;should&nbsp;have.&nbsp;&nbsp;1's&nbsp;will&nbsp;be&nbsp;pre-pended&nbsp;to&nbsp;the&nbsp;shape&nbsp;as<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;needed&nbsp;to&nbsp;meet&nbsp;this&nbsp;requirement.</tt></dd></dl>
 <dl><dt><a name="-cubic"><strong>cubic</strong></a>(args, x, y)</dt></dl>
 <dl><dt><a name="-linear"><strong>linear</strong></a>(args, x, y)</dt><dd><tt>#&nbsp;prototype&nbsp;functions&nbsp;to&nbsp;fit&nbsp;to</tt></dd></dl>
 <dl><dt><a name="-lnlinear"><strong>lnlinear</strong></a>(args, x, y)</dt></dl>
 <dl><dt><a name="-mean"><strong>mean</strong></a>(arr)</dt></dl>
 <dl><dt><a name="-meantrace"><strong>meantrace</strong></a>(arr)</dt></dl>
 <dl><dt><a name="-powerlaw"><strong>powerlaw</strong></a>(args, x, y)</dt></dl>
 <dl><dt><a name="-quadratic"><strong>quadratic</strong></a>(args, x, y)</dt></dl>
 <dl><dt><a name="-quartic"><strong>quartic</strong></a>(args, x, y)</dt></dl>
 <dl><dt><a name="-trace"><strong>trace</strong></a>(arr)</dt><dd><tt>#prototype&nbsp;reducers</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>cos</strong> = &lt;ufunc 'cos'&gt;<br>
<strong>log</strong> = &lt;ufunc 'log'&gt;<br>
<strong>sin</strong> = &lt;ufunc 'sin'&gt;</td></tr></table>
</body></html>